package com.ztgf.order.service.purchase;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.ztgf.order.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ztgf.order.mapper.purchase.PurchaseCommodityBargainLogMapper;
import com.ztgf.order.models.service.purchase.IPurchaseCommodityBargainLogService;
import com.ztgf.order.models.bo.purchase.PurchaseCommodityBargainLogSaveBO;
import com.ztgf.order.models.dto.purchase.PurchaseCommodityBargainLogDTO;

/**
 * 店铺报价日志表控制器
 *
 * @author mxli
 * @Date 2021-05-17 10:17:16
 */
@DubboService
public class PurchaseCommodityBargainLogServiceImpl extends ServiceImpl<PurchaseCommodityBargainLogMapper, PurchaseCommodityBargainLogDTO> implements IPurchaseCommodityBargainLogService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(PurchaseCommodityBargainLogSaveBO saveBO) {
        PurchaseCommodityBargainLogDTO dto = new PurchaseCommodityBargainLogDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
